/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package radiostation.common;

/**
 *
 * @author profanis
 */
public class Utilities {

    public static String toCamelCase(String inputString) {
        String result = "";
        if (inputString.length() == 0) {
            return result;
        }
        char firstChar = inputString.charAt(0);
        char firstCharToLowerCase = Character.toLowerCase(firstChar);
        result = result + firstCharToLowerCase;
        for (int i = 1; i < inputString.length(); i++) {
            char currentChar = inputString.charAt(i);
            char previousChar = inputString.charAt(i - 1);
            if (previousChar == ' ') {
                char currentCharToUpperCase = Character.toUpperCase(currentChar);
                result = result + currentCharToUpperCase;
            } else {
                char currentCharToLowerCase = Character.toLowerCase(currentChar);
                result = result + currentCharToLowerCase;
            }
        }
        return result;
    }
    
    public static String firstLetterLower(String inputString){
        String result = "";
        if (inputString.length() == 0) {
            return result;
        }
        
        char firstChar = inputString.charAt(0);
        char firstCharToLowerCase = Character.toLowerCase(firstChar);
        
        result += firstCharToLowerCase;
        for (int i = 1; i < inputString.length(); i++) {
            char currentChar = inputString.charAt(i);
            result += currentChar;    
        }
        
        return result;
    }
}
